package com.ckc.mq.consumer;

import com.ckc.mq.msg.Message01;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = Message01.QUEUE)
public class Consumer01 {

    private static final Logger logger = LoggerFactory.getLogger(Consumer01.class);

    @RabbitHandler
    public void onMessage(Message01 message01) {
        logger.info("接收到的消息: {}" , message01);
    }

}
